#ifndef __BASE_LAYER_H__
#define __BASE_LAYER_H__

#include "cocos2d.h"
#include "GlobalDef.h"

USING_NS_CC;

class BaseLayer : public CCLayer
{
public:
	BaseLayer() : m_world(NULL), m_debugDraw(NULL) {}
	virtual ~BaseLayer() 
	{
		CC_SAFE_DELETE(m_world);
		CC_SAFE_DELETE(m_debugDraw);
	}

	bool init();
	void back(CCObject*);

public:
	virtual void initWorld();
	virtual void initGround();
	virtual void draw();

protected:
	b2World* m_world;
	GLESDebugDraw* m_debugDraw;
	b2Body* m_groundBody;
	CCSize winSize;
};

#endif // __BASE_LAYER_H__